package study.lxy.dubbo_front.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import study.lxy.dubbo_api.entity.CustInfo;
import study.lxy.dubbo_api.exception.BusiException;
import study.lxy.dubbo_front.service.QueryCustService;

@RestController
@RequestMapping(value="/queryCust")
public class QueryCustController {
	
	@Autowired
	private QueryCustService queryCustService;
	
	@RequestMapping(value="/{id}",method=RequestMethod.GET)
	public CustInfo findById(@PathVariable String id) {
		
		try {
			return queryCustService.queryById(id);
		} catch (BusiException e) {
			// TODO Auto-generated catch block
			System.out.println(e.getMessage());
		}
		return null;
	}

}
